<template>
	<cl-dialog
		title="提示"
		:visible.sync="visible"
		width="500px"
		:props="{
			appendToBody: true,
			closeOnClickModal: false
		}"
	>
		<div class="confirm-body">
			<i class="el-icon-error icon" style="color: #f00;"></i>
			<span class="confirm-title">当前无法保存</span>
			<div class="confirm-content">
				<div>
					<p class="error-modal-desc">以下内容不完善，需进行修改</p>
					<div class="error-modal-list">
						<div class="error-modal-item" v-for="(item, index) in list" :key="index">
							<div class="error-modal-item-label">流程设计</div>
							<div class="error-modal-item-content">
								{{ item.name }} 未选择{{ item.type }}
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<template #footer>
			<el-button @click="visible = false">我知道了</el-button>
		</template>
	</cl-dialog>
</template>

<script>
export default {
	props: {
		list: {
			type: Array,
			default: () => []
		}
	},
	data() {
		return {
			visible: false
		};
	},
	methods: {
		open() {
			this.visible = true;
		}
	}
};
</script>

<style lang="scss" scoped>
.confirm-body {
	.confirm-title {
		color: rgba(0, 0, 0, 0.85);
		font-weight: 500;
		font-size: 16px;
		line-height: 1.4;
		display: block;
		overflow: hidden;
	}
	.confirm-content {
		margin-left: 38px;
		font-size: 14px;
		color: rgba(0, 0, 0, 0.65);
		margin-top: 8px;
	}
	> .icon {
		font-size: 22px;
		margin-right: 16px;
		float: left;
	}
}

.error-modal-desc {
	font-size: 13px;
	color: rgba(25, 31, 37, 0.56);
	line-height: 22px;
	margin-bottom: 14px;
}

.error-modal-list {
	height: 200px;
	width: 100%;
	overflow-y: auto;
	margin-right: -20px;
	padding-right: 20px;
	// box-sizing: border-box;
}

.error-modal-item {
	padding: 10px 20px;
	line-height: 21px;
	background: #f6f6f6;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	border-radius: 4px;
}

.error-modal-item-label {
	flex: none;
	font-size: 15px;
	color: rgba(25, 31, 37, 0.56);
	padding-right: 10px;
}

.error-modal-item-content {
	text-align: right;
	flex: 1;
	font-size: 13px;
	color: #191f25;
}
</style>
